REPLICATION INFORMATION

These replication files allow one to replicate the tables, figures, and results reported in Bagozzi et. al's
	"A Bayesian Split Population Survival Model for Duration Data With Misclassified Failure Events,"
	as well as those reported in its Supplemental Appendix. 

As an overview:
	If you would like to use the output files that we obtained from running our MC simulations and data applications 
	(which will take about 10 days to run everything on one Windows quad-core laptop), then just run: the R files in "Figure_1" 
	"Figure_2" "Figure_3" and "Tables_1_and_2" folders (described below) to obtain the figures and tables in the main text, and R files 
	in "Figure_*" and "Table_*"  folders for the figures and tables in the Supplemental Appendix. The codes for the validation 
	statistics are in the  "Validation_Statistics" folder. All of these scripts  only take a couple minutes per item (i.e., figure, 
	table) at most to run using  a 5 year old dual-core windows laptop (and in less than 30 seconds on a quad-core windows laptop). 
	If you would like to run the MC simulations and the data applications 	yourself, then you will have to also run:
	R files in  the "Simulation_Codes" folder (for the MC simulations), which reads in files from "Simulation_source_Codes"; and the
	"BGL_application.R" and "RBS_application.R" files (for data applications) that reads in files from "BayesMF_source_Codes" folder.
	These added codes will take about 10 days to run on a normal computer.

The main replication folder includes:

Items 1-5: run on Windows 10 operating system, Intel(R) Core(TM) i5-7300HQ CPU (Quad-Core), using R version 3.4.4. If run on Windows 8 operating system, Intel(R) Core(TM) i5-4200U CPU, 
	using R version 3.4.0 then the run time is approximately doubled. 

1. A "Supplemental_Appendix" folder, that contains the following: 
	(a) "BayesMF_source_Codes" folder that contains the Bayesian (MF) source codes (.R and .cpp) to run BGL and RBS empirical application analyses for both the main paper and the Supplemental Appendix.
		There is nothing to run in this file.
	(b) "Simulation_source_Codes" folder that cotains MC simulation source codes (.R and .cpp) to run Monte Carlo simulations in both the main paper and the Supplemental Appendix.
		There is nothing to run in this file.
	(c) "Simulation_Codes" folder that contains the codes to run MC simulation experiments 1-15 mentioned in the main paper and presented in the main paper + Supplemental Appendix.
		Total folder runtime: approx. 1 week (each .R file about half a day). 
		R packages required: foreign, car, MASS, VGAM, survival, msm, verification, corpcor, MCMCpack, Rcpp, RcppArmadillo, mvtnorm, FastGP, Zelig, pscl, mcmcse, coda, LaplacesDemon, FAdist, spBayesSurv. 
	(d) R code, do-file and BGL data (in DTA format) to produce the outputs files for the BGL application.
		Total script runtime: approx. 35 hours. R packages required: Rcpp, RcppArmadillo, foreign, mvtnorm, MASS, FastGP, MCMCpack, coda.
	(e) R code and RBS data (in DTA format) to produce the output files for the RBS application. 
		Total script runtime: approx. 25 hours. R packages required: Rcpp, RcppArmadillo, foreign, mvtnorm, MASS, FastGP, MCMCpack, coda.
	R scripts and all necessary input files for replicating:
	(e) MC simulation Tables and Figures reported in the supplemental appendix (Tables A.1-A.12 and Figures A.1-A.24).
		Each Table and Figure folder runtime: <30 seconds. R packages required: foreign, ggplot2, grDevices
	(f) Convergence diagnostic results reported in the supplemental appendix (Figures A.28-29, Tables A.14-15).
		Total folder runtime: <30 seconds. R packages required: foreign, ggplot2, grDevices.
 	(g) Additional BGL application figures (Figures A.30-33).
		Each Figure folder runtime: <30 seconds. R packages required: foreign, ggplot2, grDevices.
	(h) RBS application figures (Figures A.34-36).
		Each Figure folder runtime: <30 seconds. R packages required: foreign, ggplot2, grDevices.

2. A "Figure_1" folder, which contains the necessary R-code and simulation outputs files (in DTA and RDS format) needed to replicate Figure 1 in the main paper.  
	The code for generating the DTA file of the simulated RMSEs across various values of alpha can be found in item (e) above.
	Total folder runtime: <30 seconds. R packages required: foreign, ggplot2, grDevices

3. A "Figure_2" folder, which contains the R-code and BGL empirical analysis output file (in RDS format) needed to replicate Figures 2a-b in the main paper.
	The code for generating the RDS output for BGL analysis can be found in item (c) above. 
	Total folder runtime: <30 seconds. R packages required: foreign, ggplot2, grDevices

4. A "Figure_3" folder, which contains the R-code and BGL empirical analysis output files (in RDS format) needed to replicate Figures 3a-f in the main paper.
	The code for generating the RDS output for BGL analysis can be found in item (c) above. 
	Total folder runtime: <30 seconds. R packages required: foreign, ggplot2, grDevices

5. A "Tables_1_and_2" folder, which contains the R-code and simulation output files (in DTA format) needed to replicate Replicate Tables 1-2 in the main paper.
	The code for generating the RDS output for BGL analysis can be found in item (e) above.
	Total folder runtime: <30 seconds. R packages required: foreign

6. A "Validation_Statistics" subfolder that generates the AUC and F1 score validation test statistics that are discussed in the text at the end of the main 
	paper's application section.  Total folder runtime: 30 seconds. Run on Windows 7 operating system, using R version 3.4.2. R packages required: caTools, PRROC.


Total R Packages required across items 1-6 above: foreign, car, MASS, VGAM, survival, msm, verification, corpcor, MCMCpack, Rcpp, RcppArmadillo, mvtnorm, FastGP, Zelig, pscl, mcmcse, coda, 
							LaplacesDemon, FAdist, spBayesSurv, grDevices, ggplot2, caTools, PRROC.

Please contact Minnie M. Joo at (mxj222@psu.edu) or Benjamin E. Bagozzi (bagozzib@udel.edu) for any questions about these files.

